package org.feng.manage.sys;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.feng.manage.animal.AnimalAddManage;

import java.util.Arrays;

/**
 * 操作枚举
 *
 * @author feng
 */
@AllArgsConstructor
@Getter
public enum OperateEnum {

    ANIMAL_ADD("animal_add", AnimalAddManage.class, "新增动物"),
    //ANIMAL_UPDATE("animal_update", "修改动物"),
    ;

    private final String code;
    private final Class<? extends AbstractOperateHandlerTemplate<?, ?>> operateHandler;
    private final String desc;

    public static OperateEnum getInstance(String code) {
        return Arrays.stream(OperateEnum.values()).filter(a -> a.code.equals(code)).findAny().orElse(null);
    }
}
